## Test script for testing remote RPC CALLS WHICH NEED
## admin authentication
##
## Usage: python testAdminXMLRPC.py [local]
import os,sys
import xmlrpclib

#NODE Q3100083
user="6c626d102fe8"
pw="6c626d4ffcce"

if len(sys.argv)==2:
    #assume local mode
    server_url = 'http://%s:%s@localhost:8000/provisioner/xmlrpc/call/xmlrpc' % (user,pw)
else:
    server_url = 'http://%s:%s@update.braintrainerplus.com/xmlrpc/call/xmlrpc' % (user,pw)

server = xmlrpclib.Server(server_url)
print "TIME"
print server.giveMeTime()
#Do a fake install of package 1 on node 6c626d10d7ba
print "Package download 9"
#print server.packageDownloadStarted(9) #package ID 6!
#No clouding of DB
#print "Package install 9"
print server.saveInstallLog(9,'logje van een kivy pakket','ok')

#NEW temp test for intteligent package info
print "NODE TAGS:"
print server.getCurrentNodeTags()
print "NODE PACKAGES:"
print server.getCurrentNodePackages()
print server.getCurrentPackageInfo()

